
import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart';
import 'package:provider/provider.dart';
import 'package:sciolto/UI/HomePage.dart';
import 'package:sciolto/api/music.dart';

@deprecated
class ReadyPage extends StatelessWidget{

  @override
  Widget build(BuildContext context) {
    Music().initAllResource().then((value){
      if(value == 3){
        //Navigator.of(context).push(CustomRoute(HomePage(), 1, 100)).then((value) => Navigator.of(context).pop());
        runApp(MultiProvider(
          providers: [
            ChangeNotifierProvider(create: (_) => Music()),
          ],
          child: MaterialApp(
            home: HomePage(),
          ),
        ));
      }else{
        print('初始化出现错误');
      }
    });
    return Scaffold(
      body: Column(
        children: [
          Expanded(
            child: LayoutBuilder(
              builder: (context, constraints){
                return SizedBox(
                  width: constraints.maxWidth,
                  height: constraints.maxHeight,
                  child: FittedBox(
                    fit: BoxFit.fitWidth,
                    child: Image(
                      image: AssetImage("images/list_4.jpg"),
                    ),
                  ),
                );
              },
            ),
          )
        ],
      ),
    );
  }

}